//
//  PublishSuccessViewController.m
//  RENTVISITOR
//
//  Created by wonder on 2017/9/27.
//  Copyright © 2017年 UNN. All rights reserved.
//

#import "PublishSuccessViewController.h"
#import "RentVieitor.h"

@interface PublishSuccessViewController ()

@end

@implementation PublishSuccessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"发布租房信息";
    self.view.backgroundColor = BackgroundColor;
    [self creatLeftView];
   
    
    
}

- (void)creatLeftView {
    
    UIView *headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KWidth, 120)];
    headView.backgroundColor = [Utils colorConvertFromString:@"#1fae0c"];
    [self.view addSubview:headView];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 20, KWidth-200, 40)];
    label.text = @"发布租房信息";
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:17];
    label.textColor = [UIColor whiteColor];
    [headView addSubview:label];
    // 自定义导航栏左侧按钮
    UIButton * leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    leftBtn.frame = CGRectMake(15, 20+12, 100,30);
    [leftBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 10, 90)];
    [leftBtn setImage:[UIImage imageNamed:@"箭头左-left"] forState:UIControlStateHighlighted];
    [leftBtn setImage:[UIImage imageNamed:@"箭头左-left"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
    [headView addSubview:leftBtn];
    
    // 自定义导航栏左侧按钮
    UIButton * rightBtn = [UIButton buttonWithType:UIButtonTypeSystem];
    rightBtn.frame = CGRectMake(KWidth-65, 20+10, 50, 20);
    [rightBtn setTitle:@"完成" forState:UIControlStateNormal];
    [rightBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [rightBtn addTarget:self action:@selector(nextAction) forControlEvents:UIControlEventTouchUpInside];
    [headView addSubview:rightBtn];
    
    UIImageView *imgview = [[UIImageView alloc] initWithFrame:CGRectMake(0, 64, KWidth, KWidth*108/776)];
    imgview.image = [UIImage imageNamed:@"pulishsuccess"];
    [headView addSubview:imgview];
    
    UILabel *firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 140, KWidth, 20)];
    firstLabel.text = @"您的租房信息发布成功";
    firstLabel.textAlignment = NSTextAlignmentCenter;
    firstLabel.font = [UIFont systemFontOfSize:17];
    firstLabel.textColor = [Utils colorConvertFromString:@"#101010"];
    [self.view addSubview:firstLabel];
    
    UILabel *secondLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 170, KWidth, 13)];
    secondLabel.text = @"请保持电话畅通,现在就等着租客上门吧";
    secondLabel.textAlignment = NSTextAlignmentCenter;
    secondLabel.font = [UIFont systemFontOfSize:13];
    secondLabel.textColor = [Utils colorConvertFromString:@"#666666"];
    [self.view addSubview:secondLabel];
    
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake((KWidth-475/2)/2, 210, 475/2, 475/2)];
    imgView.image = [UIImage imageNamed:@"publish成功"];
    [self.view addSubview:imgView];
    
    
}

- (void)backAction {
    
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)nextAction {
    
    [self.navigationController popToRootViewControllerAnimated:YES];
}

@end
